﻿<%@ Page Language="C#" MasterPageFile="~/Member/UserManage.master" AutoEventWireup="true"
    CodeFile="ProTypeList.aspx.cs" Inherits="Member_ProType_ProTypeList" Title="管理自定义分类" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContInfo" runat="Server">

    <script type="text/ecmascript">
        function SelectAll()
        {
            // 找到所有的 input 元素
            var ctllist = document.getElementsByTagName("input");
            var objcheckbox= document.getElementById("CheckBox2");     
            for( var i = 0; i< ctllist.length; i++)
            {
                if(ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0 )
                {   
                    if(objcheckbox.checked==true)     
                         ctllist[i].checked = true;
                    else
                         ctllist[i].checked = false;
                }
          
             }
         }
    </script>
    <div class="inkg mar_top">
   <strong class="inkgt">
        管理自定义分类</strong>
        <div class="inso mar_top">  
    <table cellpadding="0" cellspacing="0" border="0" width="795">
        <tr>
            <td height="35">
                添加分类:<asp:TextBox ID="TxtProTypeName" runat="server"></asp:TextBox>&nbsp;&nbsp;<asp:Button
                    ID="btnSave" runat="server" Text="确定" OnClick="btnSave_Click" CssClass="del" />
            </td>
        </tr>
    </table>
    </div>
    <div class="intab mar_top" id="intab">
        <ul class="intabt">
            <li class="intabt2">自定义分类管理</li></ul>
            
        <div class="intabc" id="intabc">
            <div class="con" style="display: block">
                        <table cellpadding="0" cellspacing="0" border="0" class="edtb">
                            <thead>
            <tr>
                <td>
                    选项
                </td>
                <td>
                    排序</td>
                <td>
                    名称</td>
                    <td>
                        操作</td>
            </tr>
                            </thead>
                            <tbody>
    <asp:Repeater ID="dlstProType" runat="server" >
        <ItemTemplate>
            <tr>
                <td>
                                <input runat="server" value='<%# DataBinder.Eval(Container.DataItem,"ID")%>' id="chk" name="chk"
                                    type="checkbox" onmouseover="this.mouse='over'" onmouseout="this.mouse='out'" />
                </td>
                <td>
                    <asp:TextBox ID="txtSequence" runat="server" Text='<%# Eval("Sequence") %>' onblur="IsNum(this);"
                        CssClass="i_corp"></asp:TextBox>
                    <asp:Label ID="Lb_id" runat="server" Text='<%#Eval("ID")%>' Visible="false"></asp:Label>
                </td>
                <td>
                    <%#Eval("Name")%>
                </td>
                <td>
                    〖<asp:LinkButton ID="chongfa" runat="server" Text="编辑" Enabled="true" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID")%>'
                                    OnCommand="BtnChongfa" />
                    <asp:LinkButton ID="lbtnDelete" runat="server" Text="删除" Enabled="true" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID")%>'
                                    OnCommand="xiugai_Command" />〗 </td>
            </tr>
        </ItemTemplate>
        <%--  <EditItemTemplate>
            <tr>
                <td>
                                <input runat="server" value='<%# DataBinder.Eval(Container.DataItem,"ID")%>' id="chk" name="chk"
                                    type="checkbox" onmouseover="this.mouse='over'" onmouseout="this.mouse='out'" />
                </td>
                <td>
                    <asp:TextBox ID="txtSequence" runat="server" Text='<%# Eval("Sequence") %>' onblur="IsNum(this);"
                        CssClass="i_corp"></asp:TextBox>
                </td>
                <td style="background-color: #f8f8f8;" class="thname">
                    <asp:TextBox ID="txtName" runat="server" Text='<%# Eval("Name")%>'></asp:TextBox></td>
                <td style="background-color: #f8f8f8;" class="thcaozuo">
                    <asp:LinkButton ID="btnUpdate" runat="server" CommandName="update">更新</asp:LinkButton>
                    <asp:LinkButton ID="btnCancel" runat="server" CommandName="cancel">取消</asp:LinkButton></td>
            </tr>
        </EditItemTemplate>--%>
    </asp:Repeater>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="4">
                                    <p class="zi1">
                                                     <input runat="server" class="checkbox" type="checkbox" id="chkall" name="chkall" onclick="CheckMinoAll();" />
                                        全选
                                        <asp:Button ID="btnDelete" runat="server" Font-Size="9pt" OnClick="btnDelete_Click"
                                            OnClientClick="return CheckSelect();return confirm('你确认要删除吗?');" Text="批量删除" CssClass="del"  />
                                        <asp:LinkButton ID="LinkButton1" runat="server" Text="排序" OnClick="LinkButton1_Click"></asp:LinkButton>
                                            
                                    </p>
                                    <p class="zi2">
                                        <asp:Label ID="Pagin" runat="server"></asp:Label>
                                    </p>
                                </td>
                            </tr>
                        </tfoot>
                        </table>
                         <input type="hidden" id="CheckedIDS" name="CheckedIDS" value="0" runat="server" />
                        <asp:Label ID="lblMessage" runat="server" Text="Label" Visible="False"></asp:Label>
                        
                        
    </div>
    </div>
   </div>
    </div>
    <script type="text/javascript" src="../../js/Common.js"></script>

    <script type="text/javascript">
    $("ctl00_ContInfo_btnSave").onclick=function()
    {
    if($("ctl00_ContInfo_TxtProTypeName").value.replace(/\s/g,'')=="")
      {
        alert("添加分类不能为空!")
        $("ctl00_ContInfo_TxtProTypeName").focus();
        return false;
      }
    }
    function IsNum(obj)
	   {
		 var vlu=obj.value.replace(/\D/g,'');
		 if(obj.value!=vlu)
		 {
		  alert("输入的必须都为整数");
		  obj.focus();
		  }
		 return false;
	   }
    </script>

</asp:Content>
